Calculating the First and Follow sets

Here are some extracts from the book by Aho that explain the algorithm for calculating these sets.

FIrst

Follow

Here is an example:

example

The following shows how one can construct a parsing table:

table

Notes:

Notes (en français):